require "Util.Template"

module("TemplateTest", package.seeall, lunit.testcase)

function test_read()
        assert_true(Template.open("./sqlite.db"))

        local status, length, rows = Template.read("select * from TestTable where id = \"1\" order by id desc;")
        assert_true(status)
        assert_equal(1, length)

        local status, length, rows = Template.read("select * from TestTable where id = $id order by id;", { id = "1" })
        assert_true(status)
        assert_equal(1, length)
end

